﻿using FB.Data.Models;
using FB.Enums;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace FB.Providers.AEInfo
{
    public enum LocationType : int
    {
        Master = 0,
        Slave = 1,
    }

    [Table("BASE_AllocationHistories", Schema = "ae")]
    public class AllocationHistory : FBAuditModel
    {
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public long ID { get; set; }

        public long AEID { get; set; }

        public DateTime EffectiveDate { get; set; }

        [StringLength(8)]
        public string BCHCode { get; set; }

        [StringLength(32)]
        public string Room { get; set; }

        [StringLength(32)]
        public string Seat { get; set; }

        public decimal? RoomSize { get; set; }

        public LocationType LocationType { get; set; }

        [ForeignKey("AEID")]
        public virtual AEDetail AEDetail { get; set; }
    }


    [Table("BASE_ClientAllocationHistories", Schema = "ae")]
    public class ClientAllocationHistory : FBAuditModel
    {
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public long ID { get; set; }

        [Required][StringLength(16)]
        public string ClientCode { get; set; }

        public DateTime EffectiveDate { get; set; }

        [StringLength(8)]
        public string BCHCode { get; set; }

        [StringLength(32)]
        public string Room { get; set; }

        [StringLength(32)]
        public string Seat { get; set; }

        public decimal? RoomSize { get; set; }

        public LocationType LocationType { get; set; }

        [ForeignKey("ClientCode")]
        public virtual ClientDetail ClientDetail { get; set; }
    }


    [Table("BASE_EmployeeAllocationHistories", Schema = "ae")]
    public class EmployeeAllocationHistory : FBAuditModel
    {
        [Key, DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public long ID { get; set; }

        [Required]
        [StringLength(16)]
        public string EMPCode { get; set; }

        public DateTime EffectiveDate { get; set; }

        [StringLength(8)]
        public string BCHCode { get; set; }

        [StringLength(32)]
        public string Room { get; set; }

        [StringLength(32)]
        public string Seat { get; set; }

        public LocationType LocationType { get; set; }

        public decimal? RoomSize { get; set; }
    }

}
